package lxs.tool.liberator.work.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lxs.tool.liberator.work.param.in.MultiOptions;
import lxs.tool.liberator.work.param.out.ColumnOut;
import lxs.tool.liberator.work.pojo.Column;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ColumnMapper extends BaseMapper<Column> {
    List<ColumnOut> showTable(@Param("projectId") String projectId);

    List<Column> getMeta(@Param("dbName") String dbName, @Param("projectId") String projectId);

    List<Column> getListByClassId(@Param("classId") String classId);

    void deleteByClassIdAndUnExist(@Param("cid") String cid, @Param("names") List<String> names);

    Column getTheExist(@Param("classId") String classId, @Param("name") String name);

    String judgeExist(@Param("classId") String classId, @Param("name") String name);

    void setRules(@Param("rules") String rules, @Param("id") String id);

    void setLink(@Param("link") String link, @Param("id") String id);

    List<MultiOptions> getOptionsByClassId(String cid);

    List<MultiOptions> getOptionsByClassIdAndHaveLink(String cid);

}
